package main

import "fmt"

func BubbleSort(arr *[5]int) {
	for i := 0; i < len(arr)-1; i++ {
		for j := i + 1; j < len(arr); j++ {
			//升序
			//if arr[i]>arr[j] {
			//	temp := arr[i]
			//	arr[i] = arr[j]
			//	arr[j] = temp
			//}
			//降序
			if arr[i] < arr[j] {
				temp := arr[i]
				arr[i] = arr[j]
				arr[j] = temp
			}
		}
	}
}
func main() {
	arr := [5]int{24, 69, 80, 57, 13}
	//冒泡排序
	BubbleSort(&arr)

	fmt.Println(arr)
}
